package com.huike.clues.service.impl;

import com.huike.clues.domain.TbClue;
import com.huike.clues.domain.vo.FollowClueVo;
import com.huike.clues.mapper.TbFollowClueMapper;
import com.huike.clues.service.ITbFollowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class TbFollowServiceImpl implements ITbFollowService {

    @Autowired(required = false)
    private TbFollowClueMapper tbFollowClueMapper;

    //线索跟进
    @Transactional
    @Override
    public Boolean addTrack(FollowClueVo followClueVo , String username) {
        //需要使用username 作为表里的创建人
        followClueVo.setCreateName(username);

        return tbFollowClueMapper.addTrack(followClueVo)>0 && tbFollowClueMapper.udClue(followClueVo)>0;
    }

    @Override
    public List<TbClue> findClueTrack(Long clueId) {

        List<TbClue> clueTrack = tbFollowClueMapper.findClueTrack(clueId);
        return clueTrack;
    }


}
